 import Vue from 'vue'
 import Router from 'vue-router'
 import home from '../../../components/home.vue'
 import login from '../../../components/login.vue'
 
 Vue.use(Router);
/* 处理跳转同一个路由报错bug，另一个方法就是升级vue-router */
const originalPush = Router.prototype.push;
Router.prototype.push = function push(location){
	return originalPush.call(this, location).catch(err => err);
}
 
 let router = new Router({
	 routes: [
		 {
			 path: '/',
			 name: 'home',
			 component: home
		 },{
			 path: '/login',
			 name: 'login',
			 component: login
		 }
	 ]
 })
 
 export default router;